function register()
{
    $('#a_register').click(
        function(e)
        {
            e.preventDefault();
            
            show_modal_mask();

            //Set the popup window to center
            $('#registration').css({'top' :  winH / 2 - $('#registration').height() /2});
            $('#registration').css({'left' : winW / 2 - $('#registration').width() /2});

            $('#registration').show();
        }
    );
    $('#registration button').click(
        function(e)
        {
            e.preventDefault();
            
            // Get all user input
            var last_name   = document.getElementById('last_name').value;
            var first_name  = document.getElementById('first_name').value;
            var username    = document.getElementById('r_username').value;
            var password    = document.getElementById('r_password').value;

            // Make an ajax call to the user registration
            $.post(base_url + 'ajax_users/register',
                {last_name: last_name, first_name: first_name, username: username, password: password},
                function(data)
                {
                    if(!data.error)
                    {
                        show_modal_dialog('Registration successful, you may now login!', 3000);
                        
                        $('.modal_content input').val('');
                        $('#registration .form_messages ul').html('');
                        $('#registration .form_messages').hide();
                        $('#registration').hide();
                    }
                    else
                    {
                        $('#registration .form_messages ul').html(data.error);
                        $('#registration .form_messages').show();
                    }
                }, "json"
            );
        }
    );
}

function login()
{
    
}